{foreach from=$products item=category}
{foreach from=$category.values item=subCategory}
<div class="subHead">
	{assign var=description value=$subCategory.name->getCategoryDescription()}{$description->getName()}
	{assign var=cdescription value=$category.name->getCategoryDescription()}
	<div class="links">
		<a href="#" rel="nofollow" class="emptyList" id="emptyList{$subCategory.name->getId()}" title="{'empty group'|t}">{'empty group'|t}</a>
		<script type="text/javascript">
			{literal}
			$(function() {
				$("#emptyList{/literal}{$subCategory.name->getId()}{literal}").click(function() {
					$('#ajaxLoader').show();
					$.post("{/literal}{url label=emptyMyList}{literal}",
					{subCategoryKey:"{/literal}{$subCategory.name->getSlug()}{literal}"},
					function(response) {eval(response); $('#ajaxLoader').hide();});return false;});});{/literal}
	</script>
		<a href="http://www.facebook.com/sharer/sharer.php?u={url label=productCompare listOfProducts=$subCategory.compareLink subCategoryKey=$subCategory.name->getSlug()}&t={'Compare'|t} {$description->getName()} {$cdescription->getName()}" rel="nofollow" target="_blank" class="shareList" title="{'Share group on facebook'|t}">{'share group'|t}</a>
		<a href="{url label=productCompare listOfProducts=$subCategory.compareLink subCategoryKey=$subCategory.name->getSlug()}" class="compareProducts" title="{'compare products'|t}">{'compare products'|t}</a>
	</div>
</div>
<div id="myListProducts" class="content">
	{foreach from=$subCategory.values item=product}
	{assign var=description value=$product->getDescription($lang_id)}
	<div class="productItem">
		<a href="{url label=productView productKey=$product->getSlug() subCategoryKey=$subCategory.name->getSlug() categoryKey=$category.name->getSlug()}" title="{$product->getName()}">
			<img src="{$urlStatic}/{image src=$product->getMainImage() h=310}" alt="{$description->getName()}" class="thumb"/>
		</a>
		{assign var=manufacturer value=$product->getManufacturer()}
		<img src="{$urlStatic}/{image src=$manufacturer->getImage() h=28}" alt="{$manufacturer->getName()}" class="logo" />
		<h6>
			<a href="{url label=productView productKey=$product->getSlug() subCategoryKey=$subCategory.name->getSlug() categoryKey=$category.name->getSlug()}" title="{$product->getName()}">{$product->getName()}</a>
		</h6>
		<a href="#" id="removeProductFromList{$product->getId()}" class="remove" title="{'Remove from my list'|t}"></a>
		<script type="text/javascript">
			{literal}
			$(function() {
				$("#removeProductFromList{/literal}{$product->getId()}{literal}").click(function() {
					$('#ajaxLoader').show();
					$.post("{/literal}{url label=emptyMyList}{literal}",
					{productKey:"{/literal}{$product->getSlug()}{literal}"},
					function(response) {
						//hideMyList();
						$('#ajaxLoader').hide();
						$('#add2compare{/literal}{$product->getId()}{literal}').html('{/literal}{'add to compare'|t}{literal}');
						$('#add2compare{/literal}{$product->getId()}{literal}').attr('title','{/literal}{'add to compare'|t}{literal}');
						comparelock{/literal}{$product->getId()}{literal} = false;
						$('#add2compare{/literal}{$product->getId()}{literal}').attr('class','add2compare');
						eval(response);});return false;});});{/literal}
	</script>
	</div>{/foreach}
	<div class="clearBoth">

	</div>

</div>
{/foreach}{/foreach}